<?php
	# ##### The server-side code for exporting ####

	# Type sent as part of the URL:
	$type = $_GET['type'];
	$ext = $_GET['ext'];
	# Get the raw POST data:
	$data = file_get_contents('php://input');

	# Set the content type according to what the client-side reports:
	header('Content-type: ' . $type);

	# Force the browser to download the file:
	header('Content-disposition: attachment; filename="network.' . $ext . '"');
	# Send the data back to the browser:
	print $data;
?>